widget: Queue redraw on gtk_widget_queue_allocate()
authorBenjamin Otte <otte@redhat.com>
Fri, 30 Oct 2015 01:06:01 +0000 (02:06 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 30 Oct 2015 01:09:17 +0000 (02:09 +0100)
Mirror the behavior of gtk_widget_queue_resize() and always queue a
redraw. If we ever want to cause allocates without redraws we can add
gtk_widget_queue_allocate_no_redraw() then.

I had initially assumed gtk_widget_size_allocate() would take care of
queueing redraws, but it does not do that when neither size nor position
change. And that is obviously what's happening after
gtk_widget_queue_allocate().

Fixes buttons sometimes not redrawing (the record button in
widget-factory after locking it, all buttons when switching to the dark
theme).

gtk/gtkwidget.c

index 2c03f72e016f170e8b932246994811e511f9cfb8..fd53f5876c7c1aa355849088784a4e5b60141586 100644 (file)
@@ -5602,6 +5602,9 @@ gtk_widget_queue_allocate (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
+  if (_gtk_widget_get_realized (widget))
+    gtk_widget_queue_draw (widget);
+
   gtk_widget_set_alloc_needed (widget);
 }